package com.techsen.maven.plugins.version;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.command.checkout.CheckOutScmResult;

@Mojo(name = "pull")
public class PullMojo extends AbstractScmMojo {

    @Override
    public void execute() throws MojoExecutionException {
        try {
            CheckOutScmResult result = this.scmManager.checkOut(this.getScmRepository(), this.getFileSet());
            this.checkResult(result);
            this.getLog().info("success pull from remote scm");
        } catch (ScmException e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }
    }
    
}
